package cc.rengu.igas.bomp.biz.service.impl;

import cc.rengu.igas.bomp.common.enums.RespCodeEnum;
import cc.rengu.igas.bomp.facade.BompPublicQueryService;
import cc.rengu.igas.bomp.facade.request.*;
import cc.rengu.igas.bomp.facade.response.*;
import cc.rengu.igas.bomp.facade.result.Result;
import cc.rengu.oltp.service.model.BizException;
import cc.rengu.oltp.service.model.DubboResult;
import cc.rengu.oltp.service.realize.DubboService;
import cc.rengu.oltp.service.realize.impl.DubboServiceImpl;
import cc.rengu.utility.log.RgLog;
import cc.rengu.utility.log.RgLogger;
import com.alibaba.fastjson.JSONObject;

import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;

public class BompPublicQueryServiceImpl implements BompPublicQueryService {

    private final RgLogger rglog = RgLog.getLogger(this.getClass().getName());

    @Override
    public Result<ManagerInfoListQueryResponse> managerInfoListQuery(ManagerInfoListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<ManagerInfoListQueryResponse> result = new Result<>();
        ManagerInfoListQueryResponse managerInfoListQueryResponse = new ManagerInfoListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, ManagerInfoListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            managerInfoListQueryResponse = (ManagerInfoListQueryResponse) dubboResult.getResult();
            result.setResult(managerInfoListQueryResponse);
            managerInfoListQueryResponse.setRespCode(dubboResult.getRespCode());
            managerInfoListQueryResponse.setRespDesc(dubboResult.getRespDesc());
            result.setResult(managerInfoListQueryResponse);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("拓展经理列表查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                managerInfoListQueryResponse.setRespCode(((BizException) e).getCode());
                managerInfoListQueryResponse.setRespDesc(e.getMessage());
            } else {
                managerInfoListQueryResponse.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                managerInfoListQueryResponse.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(managerInfoListQueryResponse);
        }
        return result;
    }

    @Override
    public Result<RegionInfoQueryResponse> regionInfoQuery(RegionInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<RegionInfoQueryResponse> result = new Result<>();
        RegionInfoQueryResponse regionInfoQueryResponse = new RegionInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, RegionInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            regionInfoQueryResponse = (RegionInfoQueryResponse) dubboResult.getResult();
            result.setResult(regionInfoQueryResponse);
            regionInfoQueryResponse.setRespCode(dubboResult.getRespCode());
            regionInfoQueryResponse.setRespDesc(dubboResult.getRespDesc());
            result.setResult(regionInfoQueryResponse);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("行政区划代码查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                regionInfoQueryResponse.setRespCode(((BizException) e).getCode());
                regionInfoQueryResponse.setRespDesc(e.getMessage());
            } else {
                regionInfoQueryResponse.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                regionInfoQueryResponse.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(regionInfoQueryResponse);
        }
        return result;
    }

    @Override
    public Result<IndustryGroupInfoQueryResponse> industryGroupInfoQuery(IndustryGroupInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<IndustryGroupInfoQueryResponse> result = new Result<>();
        IndustryGroupInfoQueryResponse industryGroupInfoQueryResponse = new IndustryGroupInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, IndustryGroupInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            industryGroupInfoQueryResponse = (IndustryGroupInfoQueryResponse) dubboResult.getResult();
            result.setResult(industryGroupInfoQueryResponse);
            industryGroupInfoQueryResponse.setRespCode(dubboResult.getRespCode());
            industryGroupInfoQueryResponse.setRespDesc(dubboResult.getRespDesc());
            result.setResult(industryGroupInfoQueryResponse);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("行业组别查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                industryGroupInfoQueryResponse.setRespCode(((BizException) e).getCode());
                industryGroupInfoQueryResponse.setRespDesc(e.getMessage());
            } else {
                industryGroupInfoQueryResponse.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                industryGroupInfoQueryResponse.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(industryGroupInfoQueryResponse);
        }
        return result;
    }

    @Override
    public Result<IndustryMapInfoQueryResponse> industryMapInfoQuery(IndustryMapInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<IndustryMapInfoQueryResponse> result = new Result<>();
        IndustryMapInfoQueryResponse response = new IndustryMapInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, IndustryMapInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (IndustryMapInfoQueryResponse) dubboResult.getResult();
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("行业映射关系信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<ChannelInfoListQueryResponse> channelInfoListQuery(ChannelInfoListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<ChannelInfoListQueryResponse> result = new Result<>();
        ChannelInfoListQueryResponse response = new ChannelInfoListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, ChannelInfoListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (ChannelInfoListQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("支付通道列表查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<UnionAreaInfoQueryResponse> unionAreaInfoQuery(UnionAreaInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<UnionAreaInfoQueryResponse> result = new Result<>();
        UnionAreaInfoQueryResponse response = new UnionAreaInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, UnionAreaInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (UnionAreaInfoQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("银联地区信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<IndustryInfoQueryResponse> industryInfoQuery(IndustryInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<IndustryInfoQueryResponse> result = new Result<>();
        IndustryInfoQueryResponse response = new IndustryInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, IndustryInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (IndustryInfoQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("MCC信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<FeeTemplateListQueryResponse> feeTemplateListQuery(FeeTemplateListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<FeeTemplateListQueryResponse> result = new Result<>();
        FeeTemplateListQueryResponse response = new FeeTemplateListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, FeeTemplateListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (FeeTemplateListQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("费率模板列表查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<OrgInfoListQueryResponse> orgInfoListQuery(OrgInfoListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<OrgInfoListQueryResponse> result = new Result<>();
        OrgInfoListQueryResponse response = new OrgInfoListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, OrgInfoListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (OrgInfoListQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("机构信息列表查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<BaseProdInfoListQueryResponse> baseProdInfoListQuery(BaseProdInfoListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<BaseProdInfoListQueryResponse> result = new Result<>();
        BaseProdInfoListQueryResponse response = new BaseProdInfoListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, BaseProdInfoListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (BaseProdInfoListQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("查询基本产品信息列表处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<ProdInfoQueryResponse> prodInfoQuery(ProdInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<ProdInfoQueryResponse> result = new Result<>();
        ProdInfoQueryResponse response = new ProdInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, ProdInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (ProdInfoQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("查询产品详细信息处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<ProdInfoListQueryResponse> prodInfoListQuery(ProdInfoListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<ProdInfoListQueryResponse> result = new Result<>();
        ProdInfoListQueryResponse response = new ProdInfoListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, ProdInfoListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (ProdInfoListQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("查询标准产品信息列表处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<BankNameCodeQueryResponse> bankNameCodeQuery(BankNameCodeQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<BankNameCodeQueryResponse> result = new Result<>();
        BankNameCodeQueryResponse response = new BankNameCodeQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, BankNameCodeQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (BankNameCodeQueryResponse) dubboResult.getResult();
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("人行行号查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<ChannelLimitCfgQueryResponse> channelLimitCfgQuery(ChannelLimitCfgQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<ChannelLimitCfgQueryResponse> result = new Result<>();
        ChannelLimitCfgQueryResponse response = new ChannelLimitCfgQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, ChannelLimitCfgQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (ChannelLimitCfgQueryResponse) dubboResult.getResult();
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("通道限额配置信息查询失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<MarketingAdsInfoQueryResponse> marketingAdsInfoQuery(MarketingAdsInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MarketingAdsInfoQueryResponse> result = new Result<>();
        MarketingAdsInfoQueryResponse response = new MarketingAdsInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MarketingAdsInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (MarketingAdsInfoQueryResponse) dubboResult.getResult();
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("营销广告配置信息查询失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<EmvParamInfoQueryResponse> emvParamInfoQuery(EmvParamInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<EmvParamInfoQueryResponse> result = new Result<>();
        EmvParamInfoQueryResponse response = new EmvParamInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, EmvParamInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (EmvParamInfoQueryResponse) dubboResult.getResult();
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("EMV参数配置信息查询失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }
}
